<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="../common.jsp"%>

</head>
<body>
<script type="text/javascript">
	$(function() {
		$('#sysPermissionList').treegrid({
			url : "sysPermission/list",
			fitColumns : true,
			pagination : true,
			rownumbers : true,
			toolbar:"#toolbar",
			idField : "id",
			treeField : "text",
			animate : true,
			lines:true,
			loadFilter : function(data){
				$.each(data,function(){
					this.state = "closed";
				});
				return data;
			}

		});
	})

	function setCondition() {
		var roleids = $("#roles").combobox("getValues");
		console.log(roleids);
		var postData = {};

		$("#sysPermissionList").datagrid("reload", postData);
	}

	function resetCondition() {
		$("#conditionForm").form("clear");
	}

	function batchDelete() {
		var rows = $("#sysPermissionList").datagrid("getSelections");
		if (rows.length == 0) {
			$.messager.alert("提示", "请选择要删除的数据", "info");
			return;
		}
		//后续基本一致！
	}
</script>
	<div class="easyui-panel" title="设置查询条件"
		data-options="collapsible:true"
		style="margin-bottom: 15px; padding: 10px;">
		<form action="" id="conditionForm">
			名称：<input type="text" name="" id="username" /> <a id="btn"
				href="javascript:void(0)" onclick="setCondition()"
				class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
			<a id="btn" href="javascript:void(0)" onclick="resetCondition()"
				class="easyui-linkbutton" data-options="iconCls:'icon-redo'">重置条件</a>
		</form>
	</div>
	<table id="sysPermissionList">
		<thead>
			<tr>
				<th data-options="field:'id',width:50,sortable:true">编号</th>
				<th data-options="field:'text',width:100,sortable:true">权限名称</th>
				<th data-options="field:'type',width:100,sortable:true">类型</th>
				<th data-options="field:'url',width:100,sortable:true">地址</th>
				<th data-options="field:'percode',width:100,sortable:true">percode</th>
				<th data-options="field:'sortstring',width:100,sortable:true">sortstring</th>
				<th data-options="field:'available',width:100,sortable:true">available</th>
			</tr>
		</thead>
	</table>
	<div id="toolbar">
		<a id="btn" href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-add'">添加</a> <a id="btn"
			href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-edit'">编辑</a> <a id="btn"
			href="javascript:void(0)" onclick="batchDelete()"
			class="easyui-linkbutton" data-options="iconCls:'icon-remove'">删除</a>
		<a id="btn" href="javascript:void(0)" class="easyui-linkbutton"
			data-options="iconCls:'icon-undo'">导出</a>
	</div>
</body>
</html>